const INITIAL_STATE = {
    phone: "",
    userId: "",
    userName: "",
    userToken: "",
    cardNo: "",
    isLogin: false,
};

export default function user(state = INITIAL_STATE, action) {
    switch (action.type) {
        case "user_updateState":
            return {
                ...state,
                ...action.data,
            };
        case "user_reset":
            return {
                phone: "",
                userId: "",
                userName: "",
                userToken: "",
                cardNo: "",
                isLogin: false,
            };
        default:
            return state;
    }
}
